
#ifndef _CLASS_H_
#define _CLASS_H_


typedef struct Shape Shape;
struct Shape
{
    int width;
    int height;
    int (*area)(Shape *shape);
};

typedef struct MShape MShape;
struct MShape
{
    Shape*(*create)(int a, int b);
    void (*init)(Shape *shape, int a, int b);
};
//extern MShape MShape[1];

//-----------------------------------

typedef struct Rectangle Rectangle;
struct Rectangle
{
    Shape shape[1];
};

typedef struct MRectangle MRectangle;
struct MRectangle
{
    Rectangle* (*create)(int a, int b);
    void (*init)(Rectangle *rectangle, int a, int b);
};
//extern MRectangle MRectangle[1];

//----------------------------------
typedef struct Triangle Triangle;
struct Triangle
{
    Shape shape[1];
};

//typedef struct MTriangle MTriangle;
struct MTriangle
{
    Triangle* (*create)(int a, int b);
    void (*init)(struct Triangle *this, int a, int b);
};
//extern MTriangle MTriangle[1];

#endif

